﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace AGVController.BaseClass
{
    public class ApiRetCode
    {
        private static string GetRecMsg(double retCode)
        {
            string strMsg = "";
            switch(retCode)
            {
                case 40000:
                    strMsg = "请求不可⽤";
                    break;
                case 40001:
                    strMsg = "必要的请求参数缺失";
                    break;
                case 40002:
                    strMsg = "请求参数类型错误";
                    break;
                case 40003:
                    strMsg = "请求参数不合法";
                    break;
                case 40004:
                    strMsg = "运⾏模式错误";
                    break;
                case 40005:
                    strMsg = "⾮法的地图名";
                    break;
                case 40006:
                    strMsg = "正在烧写固件";
                    break;
                case 40007:
                    strMsg = " 烧写固件错误";
                    break;
                case 40008:
                    strMsg = "⽂件名⾮法";
                    break;
                case 40010:
                    strMsg = "关机指令出现错误";
                    break;
                case 40011:
                    strMsg = "重启指令出现错误";
                    break;
                case 40012:
                    strMsg = "调度系统控制中";
                    break;
                case 40013:
                    strMsg = "robod 错误";
                    break;
                case 40014:
                    strMsg = "robod 警告";
                    break;
                case 40015:
                    strMsg = "正在⼿动充电，不能运动";
                    break;
                case 40016:
                    strMsg = "急停状态中";
                    break;
                case 40020:
                    strMsg = "控制权被抢占";
                    break;
                case 40050:
                    strMsg = "地图解析出错";
                    break;
                case 40051:
                    strMsg = "地图不存在";
                    break;
                case 40052:
                    strMsg = "加载地图错误";
                    break;
                case 40053:
                    strMsg = "重载地图错误";
                    break;
                case 40054:
                    strMsg = "空地图";
                    break;
                case 40055:
                    strMsg = "⽂件不存在";
                    break;
                case 40056:
                    strMsg = "地图转换失败";
                    break;
                case 40057:
                    strMsg = "当前⽆可⽤ rawmap ⽂件";
                    break;
                case 40058:
                    strMsg = "当前⽆可⽤ calib ⽂件";
                    break;
                case 40060:
                    strMsg = "⾳频⽂件不存在";
                    break;
                case 40061:
                    strMsg = "播放⾳频出错";
                    break;
                case 40062:
                    strMsg = "上传⾳频⽂件失败";
                    break;
                case 40069:
                    strMsg = "保存模型⽂件出错";
                    break;
                case 40070:
                    strMsg = "模型⽂件解析错误";
                    break;
                case 40071:
                    strMsg = "标定数据解析错误";
                    break;
                case 40072:
                    strMsg = "保存标定⽂件出错";
                    break;
                case 40073:
                    strMsg = "清除标定数据出错";
                    break;
                case 40100:
                    strMsg = "请求执⾏超时";
                    break;
                case 40101:
                    strMsg = "请求被禁⽌";
                    break;
                case 40102:
                    strMsg = "机器⼈繁忙";
                    break;
                case 40199:
                    strMsg = "内部错误";
                    break;
                case 40200:
                    strMsg = "解析任务链错误";
                    break;
                case 40201:
                    strMsg = "任务链名字⾮法";
                    break;
                case 40202:
                    strMsg = "任务链不存在";
                    break;
                case 40203:
                    strMsg = "任务链正在执⾏中";
                    break;
                case 40300:
                    strMsg = "设置参数类型错误";
                    break;
                case 40301:
                    strMsg = "设置的参数不存在";
                    break;
                case 40302:
                    strMsg = "设置参数出错";
                    break;
                case 40310:
                    strMsg = "设置并保存参数类型错误";
                    break;
                case 40311:
                    strMsg = "设置并保存参数不存在";
                    break;
                case 40312:
                    strMsg = "设置并保存参数出错";
                    break;
                case 40320:
                    strMsg = "重载的参数类型错误";
                    break;
                case 40321:
                    strMsg = "重载的参数不存在";
                    break;
                case 40322:
                    strMsg = "重载参数出错";
                    break;
                case 40400:
                    strMsg = "获取控制权错误";
                    break;
                case 40401:
                    strMsg = "释放控制权错误";
                    break;
                case 41000:
                    strMsg = "初始化状态错误";
                    break;
                case 41001:
                    strMsg = "地图载⼊状态错误。通常是未获取到⾥程数据或激光数据，或者⾥程数据或激光数据未更新。";
                    break;
                case 41002:
                    strMsg = "重定位状态错误";
                    break;
                case 41003:
                    strMsg = "找不到重定位的 robotHome";
                    break;
                case 41004:
                    strMsg = "置信度过低";
                    break;
                case 41100:
                    strMsg = "找不到起点";
                    break;
                case 41101:
                    strMsg = "找不到准备点";
                    break;
                case 41102:
                    strMsg = "找不到终点";
                    break;
                case 41103:
                    strMsg = "充电点不存在";
                    break;
                case 41200:
                    strMsg = "速度值⾮法";
                    break;
                case 42000:
                    strMsg = "辊筒或⽪带连接错误";
                    break;
                case 42001:
                    strMsg = "辊筒或⽪带类型未知";
                    break;
                case 42002:
                    strMsg = "辊筒或⽪带不⽀持该指令";
                    break;
                case 42003:
                    strMsg = "顶升机构连接错误";
                    break;
                case 42004:
                    strMsg = "顶升机构类型未知";
                    break;
                case 42005:
                    strMsg = "顶升机构不⽀持该指令";
                    break;
                case 43000:
                    strMsg = "升降操作出错";
                    break;
                case 44000:
                    strMsg = "连接错误";
                    break;
                case 44001:
                    strMsg = "订阅错误";
                    break;
                case 60000:
                    strMsg = "错误的报⽂类型，若⽤户将某类型的报⽂发错了端⼝将得到这个响应";
                    break;
                case 60001:
                    strMsg = "未知的报⽂类型, 报⽂类型号未在上⽂中定义";
                    break;
                case 60002:
                    strMsg = "错误的数据区，当数据区⽆法反序列化为 JSON 对象时将得到这个响应";
                    break;
                case 60003:
                    strMsg = "协议版本错误时得到的响应";
                    break;
                case 60004:
                    strMsg = "数据区过⼤，服务器会主动断连接，限制 200 MB";
                    break;
                default:
                    strMsg = "错误码未定义";
                    break;
            }
            return strMsg;
        }
    }
}
